﻿﻿<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<!-- 避免使用IE冲突 -->
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<!-- 360切换到极速内核 -->
	<meta name="renderer" content="webkit">
	<!-- 手机搜索转码 -->
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<title>禁止报名！国家重查“挂证”，证书白考了？ - 橘子财税，办税不累</title>
	<link rel="stylesheet" href="static/css/layui.css" type="text/css" />
	<link rel="stylesheet" href="static/css/common.css" type="text/css" />
	<link rel="stylesheet" href="static/css/news-pro.css" type="text/css" />
	<link rel="stylesheet" href="static/css/font_333802_ypr9k5jwbv.css" /><link rel="stylesheet" href="static/css/iconfont.css" type="text/css" />
	<link rel="shortcut icon" href="static/images/logo.jpg" type="image/x-icon"/>

	<script type="text/javascript" src="static/js/vue.js"></script>
	<script type="text/javascript" src="static/js/axios.min.js"></script>
	<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
	<!-- 引入组件库 -->
	<script src="https://unpkg.com/element-ui/lib/index.js"></script>
	<style>
		.el-carousel__container{
			height: 420px;
		}
		.regisers{
			color: #2b9dff;
		}
		.regisers:hover{
			cursor: pointer;
			color: #155bff;
		}
		.el-menu--horizontal>.el-submenu.is-active .el-submenu__title{
			border: none;
			height: 80px;
			line-height: 80px;
		}
		.el-menu.el-menu--horizontal{
			border:none;
		}
		.tab{
			width: 80px;
			height: 40px;
			background-color: #F3F5F7;
			float: left;
			margin-right: 10px;
			margin-bottom: 10px;
			text-align: center;
			line-height: 40px;
			font-size: 14px;
			color: #8D8D8D;
		}
		.commentslist ol li {
			clear: both;
			border: 1px solid #F2F2F2;
			overflow: hidden;
			padding: 15px;
			margin-top: 20px;
		}
		.commentslist ol li .gravatar {
			float: left;
			width: 54px;
			height: 54px;
			overflow: hidden;
			margin-right: 10px;
			display: inline;
		}
		.commentslist ol li .comment-info {
			float: left;
		}
		.commentslist ol li .comment-text {
			clear: both;
			color: #666;
			font-size: 0.875em;
			padding-left: 64px;
			box-sizing: border-box;
		}
		.commentslist ol li .gravatar img {
			width: 50px;
			height: 50px;
			border: 1px solid #ddd;
			padding: 1px;
			border-radius: 50px;
			transition: transform 0.4s ease-out 0s;
		}
		.commentslist {
			clear: both;
			overflow: hidden;
			background-color: #fff;
			margin: 15px 0px;
		}
		.loading-more{
			padding: 20px 0;
			text-align: center;
		}
		.loading-more:hover{
			cursor: pointer;
			color: #999;
		}
	</style>
</head>

<body>
<div id="app">
	<!------------------------顶部导航----------------------------------->
	<div class="header">
		<div class="header-box">
			<a href="#" class="logo"><img src="static/images/logo.jpg" width="119" height="70" alt="叮叮财税">
				<span> <img src="static/images/title.png"></span>
			</a>
			<ul id="header-nav">
				<li id="index"><a href="index.html">首页</a></li>
				<li id="course"><a href="study.html">课程</a></li>
				<li id="news"><a href="consult.html">资讯</a></li>
				<li id="download"><a href="download.html">下载</a></li>
				<li id="service"><a href="service.html">服务</a></li>
			</ul>
			<div class="login rt" id="user-info">
				<el-menu class="el-menu-demo" mode="horizontal" v-if="userPhone">
					<el-submenu index="1">
						<template slot="title">{{userPhone}}</template>
						<el-menu-item index="" style="padding: 10px;width: 200px;height: 190px;position:relative;background: #fff">
							<a href="home.html"  style="width: 100%;height: 100%;display: block;">
								<div>{{userInfo.name}}{{userInfo.phone}}</div>
								<div style="overflow: hidden;">
									<div class="tab">我的课程</div>
									<div class="tab">我的收藏</div>
									<div class="tab">个人中心</div>
									<div class="tab">咨询记录</div>
								</div>
							</a>
							<div style="position:relative;z-index: 100;top: -34px;left: 90px;">
								<el-button type="primary" size="small" @click="loginOut">安全退出</el-button>
							</div>
						</el-menu-item>
					</el-submenu>
				</el-menu>
				<a href="javascript:;" class="ml-30 mr-30" id="loginBtn" @click="showLogin" v-if="!userPhone">
					<i class="login-ico"></i>登录
				</a>

				<a href="javascript:;" id="logoutBtn" @click="showRegister" v-if="!userPhone">
					<i class="regin-ico"></i>注册
				</a>
			</div>
			<div class="clearBoth"></div>
		</div>
		<div class="clearBoth"></div>
	</div>
	<!-- 弹框 -->
	<el-dialog
			:title="title"
			:visible.sync="loginDialogVisible"
			:close-on-click-modal="false"
			width="400px"
			center>
		<div>
			<el-form :model="form" :rules="rules" ref="form" label-width="60px">
				<el-form-item label="手机号" prop="phone">
					<el-input  v-model="form.phone" placeholder="请输入手机号" style="width: 300px;"></el-input>
				</el-form-item>
				<el-form-item label="密码" prop="password">
					<el-input v-model="form.password" placeholder="请输入密码" style="width: 300px;"></el-input>
				</el-form-item>
			</el-form>
			<div style="text-align: right">
				<span @click="isLogin = false" v-if="isLogin" class="regisers">去注册</span>
			</div>
			<div style="text-align: right">
				<span @click="isLogin = true" v-if="!isLogin" class="regisers">去登录</span>
			</div>
		</div>
		<span slot="footer" class="dialog-footer"  v-if="isLogin">
            <el-button @click="loginDialogVisible = false">取 消</el-button>
            <el-button type="primary" :loading="loading" @click="submitCostomer('form')">{{loading?'登录中':'登录'}}</el-button>
        </span>
		<span slot="footer" class="dialog-footer"  v-if="!isLogin">
            <el-button @click="loginDialogVisible = false">取 消</el-button>
            <el-button type="primary" :loading="loading" @click="submitCostomer('form')">{{loading?'注册中':'注册'}}</el-button>
        </span>
	</el-dialog>
	<!------------------------在线客服  / 回到顶部----------------------------------->
	<div class="tools">
		<div id="right-float" style="display:none;">
			<a href="/static/member/qjhy/index.html" target="_blank"><img src="static/picture/right-float.png"/></a>
		</div>
		<div style="height:36px;width:1px;margin-top:20px;margin-bottom:5px;">
			<div id="top" style="display: none;">
				<a href="javascript:;" style="margin-left:190px;margin-top:0px;background: transparent"></a>
			</div>
		</div>
		<div id="help">
			<a href="https://xiaojuzi.shujet.com/visitor/chat" target="_blank" style="margin-left:190px;margin-top:0px;"></a>
		</div>
	</div><!----------------面包屑导航--------------->
		<div class="navigate">
			<p>
				<a href="index.html" style="padding-left: 0;">首页</a>
				&gt;
				<a href="consult.html" style="padding-left: 0;">资讯</a>
				&gt;
				<span>正文</span>
			</p>
		</div>
		<!--------------------内容页------------------->
		<div class="content">
			<div class="container">
				<div class="sidebar-rt">
					<div class="head">
						<div class="title"><P>{{consultData.title}}</P></div>
						<div class="title-come">
							<p><span class="time">{{consultData.created_at.slice(0,10)}}</span><span class="source"></span><i class="see-ico"></i><span class="see">阅读（{{consultData.read_number}}）</span></p>
						</div>
					</div>
					<div class="Middle" v-html="consultData.content"></div>
					<div class="like">
						<p><i class="zan" @click="dianZan"></i><em>赞({{consultData.click_number}})</em></p>
					</div>

					<div class="clearBoth"></div>
					<div class="select kc-down ">
						<div id="resourceList"></div>
					</div>
					<div class="clearBoth"></div>

					<div class="article">
						<p style="padding-bottom: 10px" v-if="beforeData">
							上一篇：<a :href="'detail.html?id=' + beforeData.id" >{{beforeData.title}}</a></p>
						<p v-if="afterData">
							下一篇：<a :href="'detail.html?id=' + afterData.id" >{{afterData.title}}</a></p>
					</div>
					<div class="ping-lun">
						<div>我要评论</div>
						<div style="padding: 10px 0;">
							<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 8}" placeholder="请输入评论" v-model="pin_model"></el-input>
						</div>
						<div style="text-align: right;padding-top: 10px">
							<el-button type="primary" @click="publish" :loading="loadingPublish" v-if="token">发表</el-button>
							<el-button type="primary" @click="showLogin" v-else>登录</el-button>
						</div>
					</div>
					<div class="commentslist">
						<div>最新评论</div>
						<ol>
							<li id="comment-116254" style="border-color: rgb(242, 242, 242);" v-for="item in publishList" :key="item.id">
								<div class="gravatar">
									<img alt="" :src="item.user?item.user.icon:''" class="avatar avatar-45 photo" height="45" width="45">		</div>
								<div class="comment-info">
									<div class="comment-author">

										<a rel="nofollow" href="https://nice.im" target="_blank">{{item.user?item.user.name:''}}</a>
									</div>
									<div class="comment-time">
										<span>{{item.created_at}}</span>
									</div>
								</div>
								<div class="comment-text">
									<p>{{item.content}}</p>
								</div>
							</li>
						</ol>
						<div class="loading-more" @click="loadingMore" v-if="!noMore">点击加载更多</div>
						<div class="loading-more"  v-if="noMore">到底了</div>
					</div>
				</div>
			</div>
			<!--侧导航-->
			<div class="sidebar">
		<!--------------------最热咨询------------------->
				<div class="hot">
					<div class="hot-content">
					<span class="border_b">一周热门资讯</span>
						<ul class="news_ul">
							<li v-for="item in hotConsultData">
								<div class="n_tit">
									<a :href="'detail.html?id=' + item.id"  /><i class="ico"></i><span style="margin-left:10px ;"></span>
										{{item.title}}</a>
								</div>
							</li>
		</ul></div>
				</div>
			</div>
		</div>

		<div class="clearBoth"></div>
		<!--------------------底部------------------->
	<div class="footer">
		<div class="footer-box">
			<div class="service-nav lf">
				<dl>
					<dt>帮助中心</dt>
					<dd>
						<a href="" target="_blank">如何注册</a>
						<a href="" target="_blank">如何登陆</a>
						<a href="" target="_blank">如何观看</a>
					</dd>
				</dl>
				<dl>
					<dt>服务支持</dt>
					<dd>
						<a href="" target="_blank">服务咨询</a>
						<a href="" target="_blank">联系我们</a>
						<!--<a href="" target="_blank">服务网点</a>-->
					</dd>
				</dl>
				<dl>
					<dt>办税链接</dt>
					<dd>
						<a href="https://12366.chinatax.gov.cn/bsfw/onlinetaxation/main" target="_blank">网上办税</a>
						<a href="http://www.chinatax.gov.cn/" target="_blank">国家税务总局</a>
						<a href="http://www.sccz.gov.cn/" target="_blank">四川省财政厅</a>
					</dd>
				</dl>
			</div>

			<div class="help rt">
				<div class="help-phone">
					<i class="d-icon"></i>
					电话客服：<strong>400-6666-6666</strong>
				</div>
				<div class="huiyuan">
					<i class="h-icon"></i>
					会员专线：<strong>028-666666666</strong>
				</div>
				<!--			<div class="online">
                                <a href="" target="_blank">
                                    <i class="xinxi"></i>
                                    服务咨询
                                </a>
                            </div>-->
			</div>
			<div class="barcode rt">
				<img src="img/contact.png"/>
				<p>关注叮叮财税</p>
			</div>
		</div>
		<div class="footer-copy">
			<div class="a-box">
				<a href="">隐私条款</a> |
				<a href="">网站地图</a> |
				<a href="">版权声明</a>
			</div>
			<p>&copy;2018 成都东软学院@丁艳</p>
		</div>
	</div>
</div>
</body>
<script type="text/javascript">
    var validatePass = (rule, value, callback) => {
        if (value === '') {
            callback(new Error('请输入密码'));
        } else {
            var r = /^[^\u4e00-\u9fa5]+$/
            if(!r.test(value)){
                callback(new Error('密码不能为中文!'));
            }
            if (value.length < 6 ) {
                callback(new Error('密码长度在 6 到 18 个字符!'));
            }
            callback();
        }
    };
    var phoneValid = (rule, value, callback) => {
        let phoneReg = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/
        if (!value) {
            callback(new Error('请输入手机号码'))
        }
        if (!phoneReg.test(value)) {
            callback(new Error('请输入正确的手机号码'))
        }
        callback()
    };
    new Vue({
        el: '#app',
        data: {
            noMore: false,
            pageSize: 10,
            page:1,
            loadingPublish:false,
            publishList:[],
            pin_model: '',
            title:'',
            form: {
                phone:'',
                password:''
            },
            rules: {
                phone: [
                    { validator: phoneValid, trigger: 'change' }
                ],
                password: [
                    { validator: validatePass, trigger: 'change' }
                ]
            },
            isLogin:false,
            loading:false,
            loginDialogVisible:false,
            consultData: {},
            beforeData: {},
            afterData: {},
            hotConsultData: [],
            contentRecommendData: [],
            token: '',
            type:'0',
            ways:'latest',
            isToLogin: false,
            phone: '',
            password: '',
            errText: '',
            userPhone:'',
			userInfo:{},
			dianHttp:'http://xiaopengbest.cn/api/express/addClick',
            consultHttp: 'http://xiaopengbest.cn/api/express/news/',
            hotConsultHttp: 'http://xiaopengbest.cn/api/express/weekHotNews',
            publishHttp: 'http://xiaopengbest.cn/api/common/comment',
			getCommentsHttp: 'http://xiaopengbest.cn/api/common/comments',
			loginHttp: 'http://xiaopengbest.cn/api/user/session',
        },
        watch: {
            loginDialogVisible:function (val) {
                if (!val) {
                    Object.keys(this.form).forEach(key => this.form[key] = '');
                    this.$refs['form'].resetFields();
                }
            },
            isLogin:function (val) {
                if (val) {
                    this.title='登录';
                } else{
                    this.title='注册';
                }
            }
        },
        created() {
            this.consultHttp = this.consultHttp + this.GetRequest('id');
            this.userPhone = localStorage.getItem('userInfo')?JSON.parse(localStorage.getItem('userInfo')).phone:'';
            this.userInfo = localStorage.getItem('userInfo')?JSON.parse(localStorage.getItem('userInfo')):'';
            this.token = localStorage.getItem('token');
            if(this.token){
                this.token =(this.token.replace('"',''));
            }
            this.getConsultList();  // 分类
            this.getHotConsultList();  // 问题
            // this.getKCList();  // 课程
            this.getPublish();  // 品论
        },
        mounted() {
        },
        methods: {
            loadingMore() {
                this.page++;
                this.getPublish();
            },
            getPublish() {
                axios.get(this.getCommentsHttp,{
                    params:{
                        type:2,
                        article_id: this.GetRequest('id'),
                        page: this.page,
                        pageSize:this.pageSize
                    }

                }).then((res) => {
                    if (res.data.code == 200) {
                        if (this.page == 1) {
                            if (res.data.meta.total > this.pageSize) {
                                this.publishList = this.publishList.concat(res.data.data);
							} else {
                                this.publishList = res.data.data;
							}

						} else{
                            this.publishList = this.publishList.concat(res.data.data);
						}
                        if (this.publishList.length == res.data.meta.total) {
                            this.noMore = true;
                        }
                    }
                }).catch((err)=> {
                    this.$message.warning(err.response.data.msg || "数据异常，请重试");
                });
            },
            publish() {

                this.loadingPublish = true;
                if (!this.pin_model) {
                    this.$message.warning('评论不能为空！');
                    return false;
                }
                let params = {
                    content: this.pin_model,
                    article_id:this.GetRequest('id'),
                    type: 2,
                };
			     axios.post(this.publishHttp, params,{
                     headers: {
                         "Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
                         'Authorization': 'Bearer ' + this.token
                     },
                     transformRequest: [function (data) {
                         let ret = '';
                         for (let it in data) {
                             ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                         }
                         return ret
                     }]
				 }
                ).then((res) => {
                    if (res.data.code == 200) {
                        this.loadingPublish = false;
                        this.$message({
                            type:'success',
                            message:'发表成功',
                            duration:1000
                        });
                        this.loadingPublish = false;
                        this.pin_model = '';
                        this.publishList = [];
                        this.noMore = false;
                        this.page = 1;
                        this.getPublish();
                    }
                }).catch((err)=> {
                    this.loadingPublish = false;
                    this.$message.warning(err.response.data.msg || "数据异常，请重试");
                });
            },
			loginOut() {
				localStorage.clear();
                window.location.href = 'http://xiaopengbest.cn/index.html';
			},
            showLogin() {
                this.title='登录';
                this.isLogin = true;
                this.loginDialogVisible = true;
            },
            showRegister() {
                this.title='注册';
                this.isLogin = false;
                this.loginDialogVisible = true;
            },
            submitCostomer(formName) {
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        if (this.isLogin){
                            this.toLogin();
                        } else {
                            this.toRegister();
                        }
                    } else {
                        return false;
                    }
                });
            },
            toLogin() {
                this.loading = true;
                axios.post(this.loginHttp, {
                    phone: this.form.phone,
                    password:this.form.password
                }).then((res) => {
                    if (res.data.code == 200) {
                        this.loading = false;
                        this.$message({
                            type:'success',
                            message:'登录成功',
                            duration:1000
                        });
                        this.loginDialogVisible = false;
                        this.userPhone = res.data.data.phone;
                        localStorage.setItem('userInfo', JSON.stringify(res.data.data));
                        localStorage.setItem('token', JSON.stringify(res.data.data.api_token));
						this.token = localStorage.getItem('token');
                    }
                }).catch((err)=> {
                    this.loading = false;
                    this.$message.warning(err.response.data.msg || "数据异常，请重试");
                });
            },
            toRegister() {
                this.loading = true;
                axios.post(this.registerHttp, {
                    phone: this.form.phone,
                    password:this.form.password
                }).then((res) => {
                    if (res.data.code == 200) {
                        this.loading = false;
                        this.$message({
                            type:'success',
                            message:'注册成功,去登陆',
                            duration:1000
                        });
                        this.isLogin = true;
                    }
                }).catch((err)=> {
                    this.loading = false;
                    this.$message.warning(err.response.data.msg || "数据异常，请重试");
                });
            },
			dianZan(){
                axios.post(this.dianHttp, {
                    id: this.GetRequest('id')
                }).then((res) => {
                    if (res.data.code == 200) {
                        this.$message({
                            type:'success',
                            message:'点赞成功',
                            duration:1000
                        });
                        this.consultData.click_number++;
                    }
                }).catch((err)=> {
                    this.$message.warning(err.response.data.msg || "数据异常，请重试");
                });
			},
            GetRequest(value) {
                let url = decodeURI(location.search);
                let object = {};
                if(url.indexOf("?") != -1)
                {
                    let str = url.substr(1);
                    let strs = str.split("&");
                    for(let i = 0; i < strs.length; i ++)
                    {
                        object[strs[i].split("=")[0]]=strs[i].split("=")[1]
                    }
                }
                return object[value];
            },
            getConsultList() {
                const self = this;
                axios.get(this.consultHttp, {
                        headers: {
                            "Content-Type": "application/x-www-form-urlencoded;charset=utf-8"
                            // 'Authorization': 'Bearer ' + this.token,
                        }
                    }
                )
                    .then(function (res) {
                        self.consultData = res.data.data.content;
                        self.beforeData = res.data.data.before;
                        self.afterData = res.data.data.after;
                    }).catch(function (res) {
                    console.log(res);
                });
            },
            getHotConsultList() {
                const self = this;
                axios.get(this.hotConsultHttp, {
                        headers: {
                            "Content-Type": "application/x-www-form-urlencoded;charset=utf-8"
                            // 'Authorization': 'Bearer ' + this.token,
                        }
                    }
                )
                    .then(function (res) {
                        self.hotConsultData = res.data.data;
                    }).catch(function (res) {
                    console.log(res);
                });
            },
            getTypeList() {
                const self = this;
                axios.get(this.typeHttp, {
                        headers: {
                            "Content-Type": "application/x-www-form-urlencoded;charset=utf-8"
                            // 'Authorization': 'Bearer ' + this.token,
                        }
                    }
                )
                    .then(function (res) {
                        self.typeData = res.data.data;
                    }).catch(function (res) {
                    console.log(res);
                });
            },
            getProblemList() {
                const self = this;
                axios.get(this.problemHttp, {
                        headers: {
                            "Content-Type": "application/x-www-form-urlencoded;charset=utf-8"
                            // 'Authorization': 'Bearer ' + this.token,
                        }
                    }
                )
                    .then(function (res) {
                        self.problemData = res.data.data;
                    }).catch(function (res) {
                    console.log(res);
                });
            }
        }
    });
</script>
</html>

